package com.cyj.dream.security.exception;

import com.cyj.dream.security.component.SosAuth2ExceptionSerializer;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.springframework.http.HttpStatus;

/**
 * @Description: 方法未授权
 * @BelongsProject: DreamChardonnay
 * @BelongsPackage: com.cyj.dream.security.exception
 * @Author: ChenYongJia
 * @CreateTime: 2021-10-19 13:30
 * @Email: chen87647213@163.com
 * @Version: 1.0
 */
@JsonSerialize(using = SosAuth2ExceptionSerializer.class)
public class MethodNotAllowed extends SelfAuth2Exception {

	public MethodNotAllowed(String msg, Throwable t) {
		super(msg);
	}

	@Override
	public String getOAuth2ErrorCode() {
		return "method_not_allowed：方法未经授权，拒绝访问~";
	}

	@Override
	public int getHttpErrorCode() {
		return HttpStatus.METHOD_NOT_ALLOWED.value();
	}

}
